#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/12/28 14:45
# @Author: 周阳
# @Email: 100530987@qq.com
# @File：shangpin_page.py

from selenium.webdriver.common.by import By

class ShangPinPage:
    def __init__(self,driver):
        self.driver = driver

    enjoy_btn_locator=(By.XPATH,'//android.widget.ImageView[@resource-id=\"com.gfeng.daydaycook:id/shareButton\"]')
    top_btn_locator=(By.XPATH,'//android.view.View[@resource-id=\"ddc\"]/android.view.View[1]/android.view.View[2]')
    copy_btn_locator = (By.XPATH, '//android.widget.TextView[@text=\"复制链接\"]')
    pyq_btn_locator = (By.XPATH, '//android.widget.TextView[@text=\"朋友圈\"]')
    wx_btn_locator = (By.XPATH, '//android.widget.TextView[@text=\"微信好友\"]')
    sina_btn_locator = (By.XPATH, '//android.widget.TextView[@text=\"新浪微博\"]')


    def click_enjoy_btn(self):
        self.driver.find_element(*self.enjoy_btn_locator).click()
    def click_top_btn(self):
        self.driver.find_element(*self.top_btn_locator).click()
    def click_copy_btn(self):
        self.driver.find_element(*self.copy_btn_locator).click()
    def click_pyq_btn(self):
        self.driver.find_element(*self.pyq_btn_locator).click()
    def click_wx_btn(self):
        self.driver.find_element(*self.wx_btn_locator).click()
    def click_sina_btn(self):
        self.driver.find_element(*self.sina_btn_locator).click()
